import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:niuren_demo/configs/Colors_util.dart';
import 'package:niuren_demo/model/EntrustItem_model.dart';
import 'package:niuren_demo/model/NrAccountItem_model.dart';
import 'package:niuren_demo/view/dynamic_page/EntrustItem.dart';
import 'package:niuren_demo/view/text/text_style.dart';

class EntrustPage extends StatefulWidget {
  @override
  _EntrustPageState createState() => _EntrustPageState();
}

class _EntrustPageState extends State<EntrustPage> {
  List EntrustDataSoure = [
    {
      "date": "2020/07/20",
      "time": "20:47:30",
      "tip1":"成交",
      "tip2":"开多",
      "num": 40,
      "price": "11753.00",
      "documentary": "9/14",
      "entrust":9,
      "revoke":0,
      "deal": 0,
    },
    {
      "date": "2020/07/20",
      "time": "20:47:30",
      "tip1":"成交",
      "tip2":"开空",
      "num": 40,
      "price": "11753.00",
      "documentary": "9/14",
      "entrust":9,
      "revoke":0,
      "deal": 0,
    },
    {
      "date": "2020/07/20",
      "time": "20:47:30",
      "tip1":"成交",
      "tip2":"开多",
      "num": 40,
      "price": "11753.00",
      "documentary": "9/14",
      "entrust":9,
      "revoke":0,
      "deal": 0,
    },

  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView.builder(
        shrinkWrap: true, //为true可以解决子控件必须设置高度的问题
        physics: NeverScrollableScrollPhysics(),
        itemBuilder: (context, index) {
          if(EntrustDataSoure.contains("成交")){
          }
          return EntrustItem(dataModel: EntrustItem_Model.fromJson(EntrustDataSoure[index]),);
        },
        itemCount: EntrustDataSoure.length,
      ),
    );
  }
}
